//js-cookie 是一个第三方包 用于对浏览器的cookie进行处理

import Cookies from "js-cookie";

const tokenKey = "hmmm-Token";

//将token设置到cookie中
export const setToken = (token) => {
  Cookies.set(tokenKey, token);
};

//从cookie中读取token
export const getToken = () => {
  return Cookies.get(tokenKey);
};

//从cookie中删除token
export const removeToken = () => {
  Cookies.remove(tokenKey);
};

const timeKey = "mianmian-timestamp-key";

// 获取时间戳
export function getTimeStamp() {
  return Cookies.get(timeKey);
}
// 设置时间戳
export function setTimeStamp() {
  Cookies.set(timeKey, Date.now());
}
